package com.qiezi.bean;

import java.io.Serializable;
import java.util.Objects;

public class SiteBean implements Serializable {

//    public static String URL = "http://140.82.56.226";
    public static String URL = "http://47.92.228.122";
    private int id;
    private String name;
    private String image;




    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getImage() {
        if (image == null)return URL;
        return URL+image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    @Override
    public String toString() {

        StringBuilder stringBuilder = new StringBuilder("\n{\n\tid:").append(getId())
                .append("\n\tname:").append(getName()).append("\n}")
                .append("\n\timage:").append(getImage());
        return stringBuilder.toString();
    }

    @Override
    public int hashCode() {

        return Objects.hash(id, name);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SiteBean that = (SiteBean) o;
        return id == that.id;
    }
}
